import nprogress from 'nprogress'
import 'nprogress/nprogress.css'
nprogress.configure({
    parent: 'body'
})

function getScrollTop() {
    var scrollPos;
    if (window.pageYOffset)
    {
        scrollPos = window.pageYOffset;
    }
    else if (document.compatMode && document.compatMode != 'BackCompat')
    {
        scrollPos = document.documentElement.scrollTop;
    }
    else if (document.body)
    {
        scrollPos = document.body.scrollTop;
    }
    return scrollPos;
}

let scrollHeight = document.documentElement.scrollHeight
window.onscroll = function () {
    let scrollPos = getScrollTop();
    nprogress.set(scrollPos/ scrollHeight)
}

